package rak.r91.service;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import rak.r91.dao.SearchDao;
import rak.r91.data.ClientSearchResult;

public class SimpleSearchManager implements SearchManager{
	ApplicationContext context = new ClassPathXmlApplicationContext("conf/Spring-dao.xml");
	private SearchDao searchDao = (SearchDao) context.getBean("SearchDao");
	@Override
	public ClientSearchResult SearchClient(String condition) {
		ClientSearchResult CSR = new ClientSearchResult();
		CSR.setPersonList(searchDao.personSearch(condition));
		CSR.setEnterpriseList(searchDao.enterpriseSearch(condition));
		return CSR;
	}

}
